<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
    <base href="<%=basePath%>" />
    <title><s:text name="user.userlogin" /></title>
	<link href="css/validate.css" rel="stylesheet" type="text/css" />
</head>
<body>
<s:form action="loginAction" namespace="/" theme="simple">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" background="images/login_body_bg.gif">
  <tr>
    <td align="center" valign="middle">
	<div class="loginwrapper">
	<div class="innerlogin">
	 <div class="logo_login"><img src="images/logo.jpg"></div>
	 <div class="login">
	 <div class="login_title"><img src="images/icon_user.gif"><s:text name="user.userlogin" /></div>
	 <div class="login_input">
	 <div class="login_text">
	 <table border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td class="table_right"><s:text name="user.username"></s:text></td>
              <td height="24">
              	<s:textfield name="username" />
              </td>
            </tr>
            <tr>
              <td class="table_right"><s:property value="%{getText('user.password')}"/></td>
              <td height="24">
              	<s:password name="password"/>
              </td>
            </tr>
            <tr>
              <td class="table_right"><s:text name="user.randomstr" /></td>
              <td height="24" valign="middle">
              	<img align="absmiddle" src="randomAction.action" width="60" height="21" onClick="changerandomstr(this)" title="<s:text name="user.clickrandomstr" />">
                <s:textfield name="randomstr" class="input_60" align="absmiddle" style="width:72px;"></s:textfield>
              </td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td height="24">
              	<input type="submit" name="Submit" value="<s:text name="user.button.login" />" class="button_60" onMouseOver="this.className='button_60_over'" onMouseOut="this.className='button_60'">
              	<input type="reset" name="reset" value="<s:text name="user.button.reset" />" class="button_60" onMouseOver="this.className='button_60_over'" onMouseOut="this.className='button_60'">
              </td>
            </tr>
          </table>
		  </div>
		  <div class="login_text">
		    <h2><s:text name="user.prompttitle" /></h2>
		     	<br>
		      <s:text name="user.promptmsg" /><s:text name="user.requiredstring"><s:param><s:text name="user.randomstr" /></s:param><s:param><s:text name="user.username" /></s:param><s:param><s:text name="user.password" /></s:param></s:text>
		  </div>
		  </div>
	 </div>
	 </div>
	</div>
	</td>
  </tr>
  <tr>
  <td align="center"><DIV id="footer">
    <DIV id="f_info_reg">Copyright © XXX Co., Ltd. 1998-2010. All rights reserved.</DIV>
  </DIV></td>
  </tr>
</table>
</s:form>
</body>
	<script type="text/javascript">

    function changerandomstr(obj) 
    {   
	        //获取当前的时间作为参数，防止IE缓存   
	     var timenow = new Date().getTime();   
	        //每次请求需要一个不同的参数，否则可能会返回同样的验证码   
	     //这和浏览器的缓存机制有关系，也可以把页面设置为不缓存，这样就不用这个参数了。   
	     obj.src="randomAction.action?d="+timenow;   
    }  
	</script>
</html>